package com.oocl.action;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.oocl.dao.BookDao;
import com.oocl.dao.impl.BookDaoImpl;
import com.oocl.entity.Book;

public class FindAllBooks extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private BookDao bookDao = new BookDaoImpl();

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<Book> books = bookDao.findAllBooks();
		request.setAttribute("books", books);
		request.getRequestDispatcher("home.jsp").forward(request, response);
	}
}
